<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>这是一个div</div>
<input type="text" id="i1">
<script>
    function f() {
        let d=document.querySelector("div");
        let i=document.querySelector("#i1");
        d.innerText=i.value;
    }
  let d=document.querySelector("div") ;
  console.log(d.innerText);
  d.innerText="内容被修改了";
  let i=document.querySelector("#i1");
  i.value ="这是文本框";
</script>
</body>
</html>